An imaging digital microscope employing an infinity corrected microscope objective lens usually produces a blurred image when the object is placed outside the focal plane of the objective lens. In order to produce a sharp image, one can vary the distance between the object and objective lens until the desired sharp image is produced.
A lot of existing algorithms enabling automation of such a procedure involve optimization of a predefined merit-function, with respect to an image recorded by an array-detector of the microscope, as based on the distance between the object and the detector. Such methods depend on formation of a distinguishable image and prove effective only over an extremely limited range in the close proximity of the optimal position. When the object is placed far away from the focal plane (at the distance much larger than the depth of focus distance from the focal plane of the objective), the image is blurred so much that the merit functions (or focus functions) used for focusing vary so slowly that it is difficult to detect whether the distance between the object and the objective lens should be increased or decreased in order to achieve focusing. In practical implementation, the changes of focus function when far away from the focal plane may become buried in measurement noise.